|
|
|
| |
|
|
|
|
The OCX control used for this chapter is GRAPH32.OCX. This control ships with the professional version of Visual Basic 5, but is not installed during the normal installation process. If you have already installed Visual Basic 4, you have the GRAPH32.OCX control installed on your machine. However, if your machine only has Visual Basic 5 installed, you need to load the GRAPH32.OCX control from the Tools\Controls folder on the CD. Also, if you experience errors loading the control on your form, you need to re-register the GRAPH32.OCX control using the vbctrl.reg file that is found in the same folder. Just double-click the file to re-register your GRAPH32.OCX control. |
|
|
|
|
|
|
|
|
|
|
The Advantages of Graphing Your Data |
|
|
|
|
|
|
|
|
Although generating data graphs is not, strictly speaking, a database function, almost all good database programs provide graphing capabilities. Visual representations of data are much easier to understand than tables or lists. Providing graphs in your database programs also gives users the chance to look at data in more than one way. Often, users discover important information in their data simply by looking at it from another angle. |
|
|
|
|
|
|
|
|
Providing graphs also gives your programs an added polish that users appreciate. Quite often, users want more than a simple data entry program with a few list reports. Many times, users take data created with a Visual Basic program and export it to another Windows application in order to develop graphs and charts. Using the techniques you learn today, you can provide your users with all the graphing tools they need to develop graphs and charts without using other programs! |
|
|
|
|
|
|
|
|
Loading and Using the Graph Control |
|
|
|
|
|
|
|
|
The graph control has a multitude of properties that you can manipulate in order to customize the graph display. Only the most commonly used options are covered here. (You can review the Visual Basic documentation for detailed information on all the properties of the graph control.) In this lesson, you learn how to use graph control properties to manipulate the way graphs appear on your forms by: |
|
|
|
|
|
|
|
|
· Adding graph data using the NumPoints, NumSets, AutoInc, GraphData, and QuickData properties |
|
|
|
|
|
|
|
|
· Adding titles and legends |
|
|
|
|
|